<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

	protected function _initLogger(){
		$logger = new Zend_Log();
		$writer = new Zend_Log_Writer_Firebug();
		$logger->addWriter($writer);
		Zend_Registry::set('logger',$logger);
		$logger->info('Logger Initialized');
	}

    protected function _initAutoload() {
	$view = new Zend_View();
	$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
	$viewRenderer->setView($view);
        $libs = DIRNAME(APPLICATION_PATH) . '/library';
        $dir = new DirectoryIterator($libs);
        $autoLoader = Zend_Loader_Autoloader::getInstance();
        foreach ($dir as $fileInfo) {
            if (!$fileInfo->isDot() && $fileInfo->isDir() && substr($fileInfo->__toString(), 0, 4) != 'Zend') {
                $autoLoader->registerNamespace($fileInfo->__toString() . '_');
                $helperPath = $fileInfo->__tostring() . '/View/Helper';
                $helperName = $fileInfo . '_View_Helper';
                if (is_dir($libs . '/' . $helperPath)) {
                    $view->addHelperPath($helperPath, $helperName);
                }
            }
        }

        unset($dir);
    }



}

